1. Field of Invention
The present invention relates to a signal detector and a detecting method thereof. More particularly, the present invention relates to a peak detector and a detecting method having input signal triggering control and low frequency energy attenuation capability
2. Description of Related Art
A peak detector is a device capable of measuring the peak value of a voltage signal. However, most peak detectors have no special faculties for distinguishing between high and low frequency signals. In real applications, the capacity of a peak detector to find the degree of signal attenuation in a local area network (LAN) or transmission medium such as cable or twisted pair is very important.
FIG. 1 is a circuit diagram of a conventional peak detector. As shown in FIG. 1, the conventional peak detector 10 comprises of a comparator 12, an NMOS transistor 14, a resistor 16, a capacitor 18 and a current source 20. The positive input terminal of comparator 12 is a terminal for receiving an input signal. The negative input terminal of comparator 12 is connected to a node point N1. The output terminal of comparator 12 is connected to the gate terminal of NMOS transistor 14. The source terminal of NMOS transistor 14 is connected to the output terminal of current source 20. The drain terminal of NMOS transistor 14 is connected to node point N1. One end of resistor 16 is connected to node point N1 while the other end of resistor 16 is connected to ground GND. One end of capacitor 18 is connected to node point N1 while the other end of capacitor 18 is again connected to ground GND. The input terminal of current source 20 is connected to a voltage source VCC.
FIG. 2A is a diagram showing an example signal waveform as measured by a conventional peak detector. FIG. 3A is a diagram showing the signal waveform shown in FIG. 2A after signal attenuation.
For example, when the peak detector 10 shown in FIG. 1 is used to detect voltage peak, the detected signal before attenuation has a waveform 30 shown in FIG. 2A. Since the peak detector 10 is incapable of distinguishing between low and high frequencies, output waveform 40 is still quite rugged even after attenuation as shown in FIG. 3A. In other words, if low frequency signals are not attenuated, signal waveform measured by the peak detector is bound to contain larger ripples.
In addition, several conventional techniques related to the design of peak detectors can be found in the following U.S. Patents.
(1) John D. Young et. al, in xe2x80x9cHigh Speed Gated Peak Detectorxe2x80x9d, U.S. Pat. No. 4,6620,444.
(2) Robert H. Leonowich et. al, in xe2x80x9cMaster-Slave Peak Detectorxe2x80x9d, U.S. Pat. No. 5,254,881.
(3) Stan Dendinger et. al, in xe2x80x9cClosed-Loop Peak Detector Topologyxe2x80x9d, U.S. Pat. No. 5,428,307.
Accordingly, one object of the present invention is to provide a peak detector. The peak detector having input signal triggering control and low frequency energy attenuation capability. The peak detector includes a charging unit and a discharging unit. By being triggered by a peak value detected in a received input signal by comparing voltage potential levels of the output signal of the peak detector and the received signal, the charging unit charges an electrical charge storage unit, for example, a capacitor, connected to the output terminal of the peak detector for a pre-determined charge duration in accordance with a charge pulse being in a logic high. After the pre-determined charge duration of charging operation, before being triggered by a next peak value of the received input signal, the discharging unit discharges the electrical charge storage unit for a pre-determined discharge duration in accordance with a discharge pulse being in a logic high or in accordance with a plurality of discharge pulses, which is determined by design desired.
The invention provides a peak detector for receiving an input signal and output a peak signal from an output terminal. The peak detector comprising a comparator, a programmable pulse generator, a logic unit, an electrical charge storage unit, a charging unit and a discharge unit. The comparator receives the input signal and the peak signal and generates a comparing signal by comparing the input signal and the peak signal. The programmable pulse generator receives the comparing signal and generates a first pulse signal and a second pulse signal in according to the comparing signal. The logic unit receives the first pulse signal and the second pulse signal and outputs a first control signal and a second control signal. The electrical charge storage unit is coupled to the output terminal of the peak detector. The charging unit charges the electrical charge storage unit during a pre-determined charge duration in response to the first control signal to increase a voltage potential level of the peak signal. The discharge unit discharges the electrical charge storage unit during a pre-determined discharge duration in response to the second control signal to decrease the voltage potential level of the peak signal.
In the peak detector above, the pre-determined charge duration is determined in accordance with the period of the first pulse signal being in the logic high, and the pre-determined discharge duration is the period of the second pulse signal being in the logic high. A charging/discharging ratio of the peak detector is determined by (a pre-determined charge durationxc3x97the value of the first current source)/(a pre-determined discharge durationxc3x97the value of the second current source). The pre-determined charge duration is the period of the first pulse signal being in the logic high, and the pre-determined discharge duration is the period of the second pulse signal being in the logic high.
In the peak detector above, the programmable pulse generator is used for generating a first pulse signal and a second pulse signal in accordance with the comparing signal of the comparator and an external clock signal. In an example, the programmable pulse generator is triggered by the comparing signal and the pulse duration of the first pulse signal or the second pulse signal can be determined by the external clock signal. That means that the pre-determined charge duration and the pre-determined charge duration depend on the external clock signal.
For above-mentioned object of the invention, a method for detection a peak attitude of an input signal and output a peak signal is provided. The method comprises comparing voltage potential levels of the peak signal and the received signal and generating a first pulse signal; charging an electrical charge storage unit during a pre-determined charge duration in accordance with the first pulse signal being in a logic high; after the pre-determined charge duration, before being triggered by a next peak value of the input signal, generating a second pulse signal and discharging the electrical charge storage unit during a pre-determined discharge duration in accordance with the second pulse signal being in a logic high.
In the method above, a value of the voltage potential level of the peak signal being increased depends on the pre-determined charge duration. The electrical charge storage unit is charged by a first current source. A value of the voltage potential level of the peak signal being increased depends on the pre-determined charge duration and the value of the first current source.
In the method above, a value of the voltage potential level of the peak signal being increased depends on the pre-determined discharge duration and/or the value of the second current source.
In the method above, the electrical charge storage unit is charged by a first current source and is discharged by a second current source. A charge/discharge ratio is determined by (the pre-determined charge durationxc3x97the value of the first current source)/(the pre-determined discharge durationxc3x97the value of the second current source).
The peak detector comprises of a comparator, an input-trigger device, a gatewidth control block, an AND gate, a first current source, a second current source, a first switch, a second switch and a capacitor. The positive terminal of the comparator is used for receiving an input signal. The input terminal of the input-trigger device receives the output signal of the comparator. The input terminal of the gate-width control block is connected to the output terminal of the input-trigger device. One input terminal of the AND gate is connected to the output terminal of the comparator while the other input terminal of the AND gate is connected to one of the output terminals of the gate-width control block. The input terminal of the first current source is connected to a voltage source. The output terminal of the second current source is connected to a ground voltage. The ends of the first switch are connected to the output terminal of the first current source and the negative input terminal of the comparator respectively. Opening or closing of the first switch is controlled by the signal potential at the output terminal of the AND gate. The ends of the second switch are connected to the input terminal of the second current source and the negative terminal input terminal of the comparator respectively. Opening or closing of the second switch is controlled by the signal potential at the other output terminal of the gate-width control block. One end of the capacitor is connected to the negative input terminal of the comparator while the other end of the capacitor is connected to the ground voltage.
The peak detector of this invention uses simple circuits to obtain low frequency energy attenuation. Since the low frequency attenuation can also be programmed, the peak detector is able to find the actual average voltage peak. In addition, since the peak detector has a relatively simple design, the invention can replace the complicated analogue-to-digital converter conventionally used in detecting average energy attenuation after passing through an electric cable. The peak detector can also be used to measure voltage attenuation for signals passing through LAN, transmission medium such as cable or twisted pair or other related products.
It is to be understood that both the foregoing general description and the following detailed description are exemplary, and are intended to provide further explanation of the invention as claimed.